// JavaScript Document
function getGoogleMapKey(){
	var mapKeys = {},i;
	mapKeys['800fc.cc'] = 'ABQIAAAAp0ssKXEZ7ZL_GN9NUALG9RRmmVqFS0eJjKrxcM-PoPpUmkO4RxS8Sj8nHH5Oj4gUzDEKJKY9CETyRw'
	mapKeys['localhost'] = 'ABQIAAAAp0ssKXEZ7ZL_GN9NUALG9RT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTtGSPONaesvuOrDn1qK_YtVD63mw'
	mapKeys['127.0.0.1'] = 'ABQIAAAAp0ssKXEZ7ZL_GN9NUALG9RRi_j0U6kJrkFvY4-OX2XYmEAa76BQNKr80sBbskIvJjwzSkJyugC-Azw'
	mapKeys['800fc.com'] = 'ABQIAAAAp0ssKXEZ7ZL_GN9NUALG9RS_qjEhc1tFxFDHa4igP0xgkIz_0hTkDpoyTZUxeB4u7v64eWBWbEYS7A'
	for(i in mapKeys){
		if(location.hostname.indexOf(i)>1){
			return mapKeys[i];
		}
	}
}
function loadGoogleMap() {
	var src = 'http://ditu.google.cn/maps?file=api&amp;v=2&amp;key='+getGoogleMapKey()+'&hl=zh-CN';
    loadScript(src);
}
function loadScript(src) {
    try{
      // inserting via DOM fails in Safari 2.0, so brute force approach
      document.write('<script type="text/javascript" src="'+src+'"><\/script>');
	  document.domain;
	  
    } catch(e) {
      // for xhtml+xml served content, fall back to DOM methods
      var script = document.createElement('script');
      script.type = 'text/javascript';
      script.src = src;
      document.getElementsByTagName('head')[0].appendChild(script);
    }
}
loadGoogleMap();

//loadScript('/js/map/v1.2.js');